<%@ page contentType="text/html; charset=euc-kr" language="java" import="java.sql.*" errorPage="/include/error.jsp" session="true" %> <%@ include file = "/include/getauth.jsp"%> <%@ include file = "/include/dbconnect.jsp"%> <%-- µ¥ÀÌÅÍ º£À̽º ¿¬°á --%> <%-- Ä¿³Ø¼Ç º¯¼ö Conn --%> <% // Á¦Ç° ºÐ·ù //µðÁöÅ» ÇǾƳë : a //¾Æ¸¶µ¥¿ì½ºÅ¬·¡½Ä : b //ÀüÀÚ ¿À¸£°£ : c //ÀüÀÚ Å°º¸µå : d %> <% java.sql.Statement stmt = null; ResultSet rs = null; String strQuery; int nCount = 10; int nTotalPage = 1; int nPageNum = 1; String strType="a"; String strUsage="1"; String strA=""; String strB=""; String strC=""; String strD=""; String strE=""; String strF=""; String strX="selected"; String strIsOpen="1"; String strTitleImage = ""; //Handle form variable int nIndex=0; if(request.getParameter("pagenum") != null) { nPageNum = Integer.parseInt(request.getParameter("pagenum")); } else if(request.getParameter("productid") != null) { nIndex = Integer.parseInt(request.getParameter("productid")); nPageNum = 0; } if(request.getParameter("code") != null) { strType = request.getParameter("code"); } if(strType.equals("a")) { strA="selected"; strB=""; strC=""; strD=""; strE=""; strF=""; strX=""; strTitleImage="/webapps/img/product/pro-title1.gif"; } else if(strType.equals("b")) { strA=""; strB="selected"; strC=""; strD=""; strE=""; strF=""; strX=""; strTitleImage="/webapps/img/product/pro-title2.gif"; } else if(strType.equals("c")) { strA=""; strB=""; strC="selected"; strD=""; strE=""; strF=""; strX=""; strTitleImage="/webapps/img/product/pro-title3.gif"; } else if(strType.equals("d")) { strA=""; strB=""; strC=""; strD="selected"; strE=""; strF=""; strX=""; strTitleImage="/webapps/img/product/pro-title4.gif"; } else if(strType.equals("e")) { strA=""; strB=""; strC=""; strD=""; strE="selected"; strF=""; strX=""; strTitleImage="/webapps/img/product/pro-title5.gif"; } else if(strType.equals("f")) { strA=""; strB=""; strC=""; strD=""; strE=""; strF="selected"; strX=""; strTitleImage="/webapps/img/product/pro-title6.gif"; } else { strA=""; strB=""; strC=""; strD=""; strE=""; strF=""; strX="selected"; } if(nIndex >0) { strQuery = "Select count(productid) as count from t_product where isusage='1' and productid>=" + nIndex + " and productcode='" + strType + "'"; try { stmt = conn.createStatement(); rs = stmt.executeQuery(strQuery); if(rs.next()) nPageNum = (int)(rs.getInt("count")/nCount) + 1; } catch(SQLException e) { out.print(e.getMessage()); } finally { if(stmt != null) stmt.close(); if(rs != null) rs.close(); } } // Get total page number strQuery = "Select count(productid) as count from t_product where isusage='1' and productcode='" + strType + "'"; try { stmt = conn.createStatement(); rs = stmt.executeQuery(strQuery); rs.next(); nTotalPage = (int)(rs.getInt("count")/nCount) + 1; } catch(SQLException e) { throw e; } finally { if(stmt != null) stmt.close(); if(rs != null) rs.close(); } int nNum = (nPageNum-1) * nCount+1; int nStartID = 0; strQuery = "Select productid from t_product where isusage='1' and productcode='" + strType + "' Order By productid DESC Limit " + nNum; try { stmt = conn.createStatement(); rs = stmt.executeQuery(strQuery); while(rs.next()) { nStartID = rs.getInt("productid"); } } catch(SQLException e) { throw e; } finally { if(stmt != null) stmt.close(); if(rs != null) rs.close(); } strQuery = "Select productid, productmodel, intro, smallimage, writeDate, isusage, catalog from t_product where isusage='1' and productid <= " + nStartID; strQuery += " and productcode='" + strType + "' Order By productid DESC Limit " + nCount; try { stmt = conn.createStatement(); rs = stmt.executeQuery(strQuery); %> µðÁöÅÐÇǾƳëÀÇ ´ë¸í»ç ´ÙÀ̳ªÅæ
<%@ include file="/include/top_left.jsp" %> <% } catch(SQLException e) { throw e; } finally { if(stmt != null) stmt.close(); if(rs != null) rs.close(); } %> <%@ include file="/include/bottom.jsp" %>
<%@ include file="/include/flash_product.jsp" %>
<%@ include file="/include/login.jsp" %> <%@ include file="/include/search.jsp" %> <%@ include file="/include/product_menu.jsp" %>

  Home > Á¦Ç°¼Ò°³
border=0>
  °Ô½Ã¹°¸ñ·Ï : Page <%=nPageNum%>/<%=nTotalPage%>
<% while(rs.next()) { %> <% } %>
">" border=0> <%=rs.getString("productmodel")%>   <% if(rs.getString("catalog") != null && rs.getString("catalog").length() >=1) { %>"><% } %>

"> <%=rs.getString("intro")%>

<% int nPages = (int)(nPageNum-1)/10; int i=nPages*10+1; int nLast = (nPages+1)*10; int nPrevious = i-1; int nCurrentIndex=0; if(i > 1) out.print("<<  "); else out.print(" "); for(;i<=nLast;i++) { if(i!= nPageNum) out.print(" " + i +"  "); else out.print(" "+ i + "  "); nCurrentIndex = i; if(nCurrentIndex >= nTotalPage) break; } if(nCurrentIndex < nTotalPage) { out.print(" >>  "); } else out.print(" "); %> <% if(strAuth.equals("a")) { %>

<% } %>

<%@ include file="/include/top_right.jsp" %>
<%@ include file = "/include/dbclose.jsp"%>